package cn.funnymap.lgis.utils;

import java.util.UUID;

/**
 * @author jiaoxn
 */
public class UuidUtil {
    private UuidUtil() {}

    public static String random() {
        return UUID.randomUUID().toString();
    }

    public static String random(String value) {
        return UUID.nameUUIDFromBytes(value.getBytes()).toString();
    }

    public static String randomWithoutStrike() {
        return random().replace("-", "");
    }
    public static String randomWithoutStrike(String value) {
        return random(value).replace("-", "");
    }

    public static String replaceStrikeByTargetChar(String replaceStr) {
        return random().replace("-", replaceStr);
    }
    public static String replaceStrikeByTargetChar(String replaceStr, String value) {
        return random(value).replace("-", replaceStr);
    }

    public static UUID fromString(String value) {
        return UUID.fromString(value);
    }
}
